from art import tprint
from time import sleep
import sys
from installer import Installer

class Build:
    @staticmethod 
    def run():
        tprint('Hyprkofi!', font='small')
        hello_lbl = 'Hi friend!\nThis script is an auto-installer kofies hyprland\ndotfiles on your artix linux with openrc'
        Build.printw(ptxt=hello_lbl+'\n')
        if Build.checkansw('0) Do you want to continue?'):
            Installer._install_with_opts(Build.get_options())
    @staticmethod
    def checkansw(answer: str) -> bool:
        Build.printw(answer+' [y/n] ')
        if 'y' in input().lower():
            return True
        else:
            return False
    @staticmethod
    def printw(ptxt, delay=0.02):
        for char in ptxt:
            print(char, end='')
            sys.stdout.flush()
            sleep(delay)
    @staticmethod
    def get_options(): 
        option_1 = Build.checkansw('1) Update pacman db?')
        option_2 = Build.checkansw('2) Install additional software: firefox, neovim and so on?')
        option_3 = Build.checkansw('3) Install balena-etcher, metasploit-git and cava?')
        option_4 = Build.checkansw('4) Are you using a laptop?')
        option_5 = Build.checkansw('5) Install  mesa xf86-video-nouveau xf86-video-intel vulkan-intel?')
        option_6 = Build.checkansw('6) Install wal-telegram?')
        option_7 = Build.checkansw('7) Install pywalfox?')
        return [option_1, option_2, option_3, option_4, option_5, option_6, option_7]

if __name__ == '__main__':
    Build.run()
